package com.changgou.goods.dao;

import com.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BrandMapper extends Mapper<Brand> {
@Select ("SELECT NAME,image \n" +
        "FROM tb_brand \n" +
        "WHERE id IN \n" +
        "(SELECT brand_id FROM tb_category_brand WHERE category_id IN \n" +
        "(SELECT id FROM tb_category WHERE NAME='categoryName') )ORDER BY seq\n")
    List<Brand> findBrandCategoryName(String categoryName);
}
